/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pagoda;

import java.util.List;
import pagoda.commands.PagodaRootCommand;
import pagoda.util.cli.Cmdlet;

/**
 *
 * @author kevin
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        PagodaRootCommand rcmd = new PagodaRootCommand();

        if(args.length == 0)
        {
            rcmd.displayHelp();
            return;
        }

        List<Cmdlet> cmds = rcmd.parse(args);
        for(Cmdlet cmd : cmds)
        {
            int ecode = cmd.execute();
            if(ecode > 0)
                System.exit(ecode);
        }
    }

}
